import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class ArrayListCollectionInterface {
    public static void main(String[] args) {
        Collection<Integer> list = new ArrayList<>();

        list.add(1);
        list.add(2);
        list.add(3);

        /*for (int i = 0; i < list.size(); i++) {
        }*/

        Collection<Integer> collection = new ArrayList<>();
        collection.add(9);
        collection.add(8);
        collection.add(7);

        list.addAll(collection);

        int size = list.size();
        System.out.println("size = " + size);

        // collection.clear();
        boolean empty = collection.isEmpty();
        System.out.println("empty = " + empty);

        boolean contains = list.contains(9);
        System.out.println("contains = " + contains);

        boolean containsAll = list.containsAll(collection);
        System.out.println("containsAll = " + containsAll);

        list.remove(2);
        list.removeAll(collection);

        boolean equals = list.equals(collection);
        System.out.println("equals = " + equals);

        Object[] objects = list.toArray();

        int hashCode = list.hashCode();
        System.out.println("hashCode = " + hashCode);

        Iterator<Integer> iterator = list.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }


    }
}
